package com.qk.management.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.dto.log.LogDTO;
import com.qk.entity.Log;
import com.qk.management.mapper.LogMapper;
import com.qk.management.service.LogService;
import com.qk.vo.log.LogPageVO;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements LogService {
    @Override
    public PageResult<LogPageVO> getLogs(LogDTO dto) {
        Page<LogPageVO>list = this.baseMapper.selectLogs(new Page<>(dto.getPage(), dto.getPageSize()), dto);
        return PageResult.<LogPageVO>builder()
                .total(list.getTotal())
                .rows(list.getRecords())
                .build();
    }
}
